home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / dosref23.zip / CHAPTER.002 < prev    next >
Text File  |  1992-03-16  |  82KB  |  1,341 lines

  1.  
  2.        **  Programmer's Technical Reference for MSDOS and the IBM PC **
  3.                 USA copyright TXG 392-616  ALL RIGHTS RESERVED
  4. ───────────────────────────────┤ DOSREF (tm) ├────────────────────────────────
  5.                      ISBN 1-878830-02-3 (disk-based text)
  6.                     Copyright (c) 1987, 1992 Dave Williams
  7.                         ┌─────────────────────────────┐
  8.                         │ Shareware Version, 03/16/92 │
  9.                         │  Please Register Your Copy  │
  10.                         └─────────────────────────────┘
  11.  
  12.  
  13.                              C H A P T E R   T W O
  14.  
  15.  
  16.  CPU Port Assignments, System Memory Map, BIOS Data Area, Interrupts 00h to 09h
  17.  
  18.  
  19.  
  20.                                 C O N T E N T S
  21.  
  22. Introduction .......................................................... 2**1
  23. System Memory Map ..................................................... 2**2
  24. A Brief Guide to Current Memory Terminology ........................... 2**3
  25. PC Port Assignment .................................................... 2**4
  26. Reserved Memory Locations ............................................. 2**5
  27. Absolute Addresses .................................................... 2**6
  28. The IBM PC System Interrupts (Overview) ............................... 2**7
  29. Quick Chart of Interrupts 00h-0FFh .................................... 2**8
  30. The IBM-PC System Interrupts 00h-0Fh (in detail) ...................... 2**9
  31.  
  32.  
  33.  
  34. Introduction .......................................................... 2**1
  35.  
  36.  For consistency in this reference, all locations and offsets are in
  37. hexadecimal unless otherwise specified. All hex numbers are prefaced with a
  38. leading zero if they begin with an alphabetic character, and are terminated
  39. with a lowercase H (h). The formats vary according to common usage.
  40.  
  41.  
  42.  
  43. System Memory Map ..................................................... 2**2
  44.  
  45.  The IBM PC handles its address space in 64k segments, divided into 16k
  46. fractions and then further as necessary.
  47.  
  48. ┌──────┬─────┬─────┬──────────────────────────────────────────────────────────┐
  49. │start │start│end  │                                                          │
  50. │addr. │addr.│addr.│                          usage                           │
  51. │(dec) │   (hex)   │                                                          │
  52. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  53. │   *640k RAM Area*                                                           │
  54. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  55. │ 0k   │           │  start of RAM, first K is interrupt vector table         │
  56. │ 16k  │00000-03FFF│  PC-0 system board RAM ends                              │
  57. │ 32k  │04000-07FFF│                                                          │
  58. │ 48k  │08000-0BFFF│                                                          │
  59. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  60. │ 64k  │10000-13FFF│  PC-1 system board RAM ends                              │
  61. │ 80k  │14000-17FFF│                                                          │
  62. │ 96k  │18000-1BFFF│                                                          │
  63. │ 112k │1C000-1FFFF│                                                          │
  64. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  65. │ 128k │20000-23FFF│                                                          │
  66. │ 144k │24000-27FFF│                                                          │
  67. │ 160k │28000-2BFFF│                                                          │
  68. │ 176k │2C000-2FFFF│                                                          │
  69. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  70. │ 192k │30000-33FFF│                                                          │
  71. │ 208k │34000-37FFF│                                                          │
  72. │ 224k │38000-3BFFF│                                                          │
  73. │ 240k │3C000-3FFFF│                                                          │
  74. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  75. │ 256k │40000-43FFF│  PC-2 system board RAM ends                              │
  76. │ 272k │44000-47FFF│                                                          │
  77. │ 288k │48000-4BFFF│                                                          │
  78. │ 304k │4C000-4FFFF│                                                          │
  79. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  80. │ 320k │50000-53FFF│                                                          │
  81. │ 336k │54000-57FFF│                                                          │
  82. │ 352k │58000-5BFFF│                                                          │
  83. │ 368k │5C000-5FFFF│                                                          │
  84. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  85. │ 384k │60000-63FFF│                                                          │
  86. │ 400k │64000-67FFF│                                                          │
  87. │ 416k │68000-6BFFF│                                                          │
  88. │ 432k │6C000-6FFFF│                                                          │
  89. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  90. │ 448k │70000-73FFF│                                                          │
  91. │ 464k │74000-77FFF│                                                          │
  92. │ 480k │78000-7BFFF│                                                          │
  93. │ 496k │7C000-7FFFF│                                                          │
  94. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  95. │ 512k │80000-83FFF│                                                          │
  96. │ 528k │84000-87FFF│                                                          │
  97. │ 544k │88000-8BFFF│  the original IBM PC-1 BIOS limited memory to 544k       │
  98. │ 560k │8C000-8FFFF│                                                          │
  99. ├──────┼───────────┼──────────────────────────────────────────────────────────┤
  100. │ 576k │90000-93FFF│                                                          │
  101. │ 592k │94000-97FFF│                                                          │
  102. │ 609k │98000-9BFFF│                                                          │
  103. │ 624k │9C000-9FFFF│  to 640k (top of RAM address space)                      │
  104. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  105. │A0000 ***** 64k ***** EGA/VGA starting address                               │
  106. │A0000 ***** 64k ***** Toshiba 1000 DOS ROM (MS-DOS 2.11V)                    │
  107. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  108. │ 640k │A0000-A95B0│  MCGA 320x200 256 color video buffer                     │
  109. │      │     -AF8C0│  MCGA 640x480 2 color video buffer                       │
  110. │      │     -A3FFF│                                                          │
  111. │ 656k │A4000-A7FFF│                                                          │
  112. │ 672k │A8000-ABFFF│      this 64k segment may be used for contiguous DOS     │
  113. │ 688k │AC000-AFFFF│      RAM with appropriate hardware and software          │
  114. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  115. │B0000 ***** 64k ***** mono and CGA address                                   │
  116. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  117. │ 704k │B0000-B3FFF│  4k  monochrome display   | The PCjr and early Tandy 1000│
  118. │ 720k │B4000-B7FFF│                           | BIOS revector direct write to│
  119. │ 736k │B8000-BBFFF│  16k CGA uses             | the B8 area to the Video Gate│
  120. │ 756k │BC000-BFFFF│                           | Array and reserved system RAM│
  121. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  122. │C0000 ***** 64k *************** expansion ROM                                │
  123. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  124. │ 768k │C0000-C3FFF│  16k EGA BIOS C000:001E EGA BIOS signature (letters IBM  │
  125. │ 784k │C4000-C5FFF│                                                          │
  126. │      │C6000-C63FF│  256 bytes Professional Graphics Display comm. area      │
  127. │      │C6400-C7FFF│                                                          │
  128. │ 800k │C8000-CBFFF│  16k hard disk controller BIOS, drive 0 default          │
  129. │      │CA000      │      some 2nd floppy (high density) controller BIOS      │
  130. │ 816k │CC000-CDFFF│   8k IBM PC Network NETBIOS                              │
  131. │      │CE000-CFFFF│                                                          │
  132. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  133. │D0000 ***** 64k ***** expansion ROM                                          │
  134. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  135. │ 832k │D0000-D7FFF│  32k IBM Cluster Adapter  | PCjr first ROM cartridge     │
  136. │      │      DA000│  voice communications     | address area.                │
  137. │ 848k │D4000-D7FFF│                           | Common expanded memory board │
  138. │ 864k │D8000-DBFFF│                           | paging area.                 │
  139. │ 880k │DC000-DFFFF│                           |                              │
  140. │      │DE000      │  TI Pro default video buffer, 4k in length               │
  141. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  142. │E0000 ***** 64k ***** expansion ROM                                          │
  143. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  144. │ 896k │E0000-E3FFF│                           | PCjr second ROM cartridge    │
  145. │ 912k │E4000-E7FFF│                           | address area                 │
  146. │ 928k │E8000-EBFFF│                           |                              │
  147. │ 944k │EC000-EFFFF│                           |    spare ROM sockets on AT   │
  148. ├──────┴───────────┴──────────────────────────────────────────────────────────┤
  149. │F0000 ***** 64k ***** system                                                 │
  150. ├──────┬───────────┬──────────────────────────────────────────────────────────┤
  151. │ 960k │F0000-F3FFF│  reserved by IBM          |    cartridge address         │
  152. │ 976k │F4000-     │                           |    area (PCjr cartridge      │
  153. │      │F6000      │  ROM BASIC Begins         |    BASIC)                    │
  154. │ 992k │F8000-FB000│                           |                              │
  155. │ 1008k│FC000-FFFFF│  ROM BASIC and original   |                              │
  156. │      │           │  BIOS (Compatibility BIOS |                              │
  157. │      │           │  in PS/2)                 |                              │
  158. │ 1024k│      FFFFF│  end of memory (1024k) for 8088 machines                 │
  159. ├──────┼───────────┴─┬────────────────────────────────────────────────────────┤
  160. │ 384k │100000-15FFFF│ 80286/AT extended memory area, 1Mb motherboard         │
  161. │ 15Mb │100000-FFFFFF│ 80286/AT extended memory address space                 │
  162. │ 15Mb │160000-FDFFFF│ Micro Channel RAM expansion (15Mb extended memory)     │
  163. │ 128k │FE0000-FFFFFF│ system board ROM            (PS/2 Advanced BIOS)       │
  164. ├──────┼─────────────┴───┬────────────────────────────────────────────────────┤
  165. │  64k │C0000000-C000FFFF│ Weitek "Abacus" math coprocessor memory-mapped I/O │
  166. └──────┴─────────────────┴────────────────────────────────────────────────────┘
  167.  
  168.  Note that the ROM BIOS has a duplicated address space which causes it to
  169. "appear" both at the end of the 1 megabyte real mode space and at the end of
  170. the 16 megabyte protected mode space. The addresses from 0E0000 to 0FFFFF are
  171. equal to 0FE0000 to 0FFFFFF. This is necessary due to differences in the memory
  172. addressing between Real and Protected Modes.
  173.  
  174.  
  175.  
  176. A Brief Guide to Current Memory Terminology ........................... 2**3
  177.  
  178. LOW MEMORY - 0000h to around 0:5(something), comprising the 80x8x interrupt
  179.              vector table, the BIOS Data Area, DOS Data Area, etc.
  180.  
  181. CONVENTIONAL MEMORY - from the end of low memory to the beginning of the
  182.              "reserved by IBM" A000 segment (640k).
  183.  
  184. HIGH MEMORY - originally noncontiguous RAM stuffed into the "reserved for
  185.              ROM expansion" areas, typically segments D000 and E000. DOS
  186.              normally can't access this memory without a driver of some
  187.              sort, but it's easy to put RAMdisks and stuff in there.
  188.  
  189. CONVENTIONAL MEMORY - extra RAM stuck at A000, assuming the machine already
  190.              has 640k, appears as conventional memory accessible to DOS
  191.              and applications. IBM clones can typically add 64k before
  192.              bumping into a mono card or 96k before hitting a color card.
  193.              This address is part of the EGA/VGA video RAM area and most
  194.              EGA cards don't like system memory at A000.
  195.  
  196. EXPANDED MEMORY - LIM 3.2, LIM 4.0, or EEMS 3.2 bank switched memory. A
  197.              RAM "window" allows an app to save a block of RAM to an expansion
  198.              board. The window size and location varies according to the
  199.              EMS standard being used.
  200.  
  201. EXTENDED MEMORY - this is the "native mode" address space of the 80286 and
  202.              later chips. The "real mode", or 8088 addressing scheme,
  203.              sees RAM as a collection of segments and offsets with a limit
  204.              on segment size. "Protected mode" addressing uses a flat linear
  205.              addressing scheme. 8088 and 80188 chips do not have extended
  206.              memory.
  207.  
  208. HIGH MEMORY - by fiddling a bit with the segment/offset stuff, you can
  209.              get an extra block of addressable 8088-mode memory just over
  210.              the 1 meg address space. Microsoft issued their "HMA" (High
  211.              Memory Area) standard to try to standardize use of this block.
  212.              Though it really is "high" memory, "high" had for many years
  213.              referred to memory between 640k and 1mb. This creates more
  214.              confusion for new programmers.
  215.  
  216. EMS - this is expanded memory as described above
  217.  
  218. XMS - Microsoft is pushing an "Extended Memory Standard" which defines
  219.       a page-switching scheme much like EMS. The only real difference is
  220.       that XMS uses protected-mode RAM instead of a special paged RAM board.
  221.  
  222. XMS - some severely brain-damaged jerk at IBM issued documentation for some
  223.       IBM *EMS* boards referring to the boards as *XMS*. This was a classic
  224.       blunder, and now some IBM-followers are picking up the aberrant
  225.       terminology. This is guaranteed to confuse some people. To make it
  226.       simple, if it needs an expansion board, it is EMS no matter what the
  227.       vendor calls it.
  228.  
  229.  
  230. PC Port Assignment .................................................... 2**4
  231.  
  232.  
  233.  These are functions common across the IBM range. The PCjr, PC-AT, PC
  234. Convertible and PS/2 (both buses) have enhancements. In some cases, the
  235. AT and PS/2 series ignore, duplicate, or reassign ports arbitrarily. If
  236. your code incorporates specific port addresses for video or system board
  237. control it would be wise to have your application determine the machine
  238. type and video adapter and address the ports as required.
  239.  
  240.  hex address                   Function                   Models
  241.                                                 PCjr|PC|XT|AT|CVT|M30|PS2
  242.  
  243.  0000-000F      8237 DMA controller                  PC
  244.  0010-001F      8237 DMA controller                        AT         PS2
  245.  0020-0027      8259A interrupt controller
  246.  0020-002F      IOSGA interrupt function                              PS2
  247.  0020-003F      8259A interrupt controller  (AT)
  248.  0020-0021      interrupt controller 1, 8259A        PC    AT         PS2
  249.  0040-0043      programmable timer 8253              PC
  250.  0040-0047      programmable timers                                   PS2
  251.  0040-005F      8253-5 programmable timers                 AT
  252.                 note 1) 0041 was memory refresh in PCs. Not used in PS/2.
  253.                      2) A few early 80386 machines used static RAM and did
  254.                         not use refresh at all. The PCjr refreshes by the
  255.                         video vertical retrace signal.
  256.  0060-0063      keyboard controller 8255A            PC
  257.  0060-006F      8042 keyboard controller                   AT
  258.  0060           IOSGA keyboard input port                             PS2
  259.  0061           speaker                         PCjr PC XT AT CVT
  260.  0061           IOSGA speaker control                             M30 PS2
  261.  0061           On some clones, setting or clearing bit 2 controls Turbo mode
  262.  0061           Toshiba 1000 - system command
  263.  0062           IOSGA configuration control                       M30 PS2
  264.  0062           Toshiba 1000 - System Status, port C
  265.  0063           SSGA, undocumented                                    PS2
  266.  0063           Toshiba 1000 - mode set
  267.  0064           keyboard auxiliary device                             PS2
  268.  0065-006A      SSGA, undocumented                                    PS2
  269.  006B           SSGA, RAM enable/remap                                PS2
  270.  006C-006F      SSGA, undocumented                                    PS2
  271.  0070           AT CMOS write internal register
  272.  0071           AT CMOS read internal register
  273.  0070-0071      CMOS real-time clock, NMI mask                        PS2
  274.  0070-007F      CMOS real-time clock, NMI mask             AT
  275.  0074-0076      reserved                                              PS2
  276.  0800-008F      SSGA DMA page registers                               PS2
  277.  0080-009F      DMA page registers, 74LS612                AT
  278.  0090           central arbitration control port (Micro Channel)
  279.  0091           card selected feedback           (Micro Channel)
  280.  0092           system control port A            (Micro Channel)
  281.  0093           reserved                         (Micro Channel)
  282.  0094           system board setup               (Micro Channel)
  283.  0096           POS "CD SETUP" selector          (Micro Channel)
  284.  00A0-00A1      Interrupt controller 2, 8259A              AT         PS2
  285.  00A0-00AF      IOSGA NMI mask register                               PS2
  286.  00B0-00BF      realtime clock/calendar, (undocumented)               PS2
  287.  00C0-00DF      reserved                        PCjr PC XT AT CVT M30
  288.  00C0-00CF      DOS ROM register, Toshiba 1000
  289.  00D0-00EF      "special" register, Toshiba 1000
  290.       00C0      0C1 key register, Toshiba 1000
  291.       00C1      keyboard transfer register, Toshiba 1000
  292.       00C2      keyboard receive register, Toshiba 1000
  293.       00C3      keyboard status register, Toshiba 1000
  294.       00C8      DOS ROM page register, Toshiba 1000
  295.       00E0      CPU speed control, Toshiba 1000
  296.       00E1      keyboard status/0E2 key register, Toshiba 1000
  297.       00E2      work register, Toshiba 1000
  298.       00E3      0E4 key register, Toshiba 1000
  299.       00E4      system control register 0, Toshiba 1000
  300.       00E4      Weitek ABACUS NDP - bit 0=1, ABACUS is present
  301.       00E5      0E6 key register, Toshiba 1000
  302.       00E6      system control register 1, Toshiba 1000
  303.       00EE      EMS unit index, Toshiba 1000
  304.       00EF      EMS unit data, Toshiba 1000
  305.  00C0-00DF      DMA controller 2, 8237A-5                  AT         PS2
  306.  00E0-00EF      realtime clock/calendar  (undocumented)           M30 PS2
  307.  00F0-00FF      PS/2 math coprocessor I/O  (Model 50+)  (diskette IO on PCjr)
  308.  0100-0101      PS/2 POS adapter ID response            (Micro Channel)
  309.  0102-0107      PS/2 POS adapter configuration response (Micro Channel)
  310.  01F0-01F8      hard disk                                  AT         PS2
  311.  0200-0201      game-control adapter (joystick)
  312.  0200-020F      game controller                      PC    AT
  313.  0208-0209      Chips & Technology CS8221 chipset default EMS ports
  314.                 alternate addresses: 218h, 258h, 268h, 2A8h, 2B8h, 2E8h
  315.  0208-020F      Toshiba 1000 - EMS unit I/O #1
  316.  020C-020D      reserved by IBM
  317.  0210-0217      expansion box (PC, XT)
  318.  0218-021F      Toshiba 1000 - EMS unit I/O #2
  319.  021F           reserved by IBM
  320.  0258-025F      Toshiba 1000 - EMS unit I/O #3
  321.  0258-0259      LIM EMS 3.1 (not defined in 3.2+)
  322.  0268-026F      Toshiba 1000 - EMS unit I/O #4
  323.  0278-027F      parallel printer port 2                    AT
  324.  0278-027B      parallel printer port 3                               PS2
  325.  02A2           clock chip in early Sperry PCs
  326.  02A8-02AF      Toshiba 1000 - EMS unit I/O #5
  327.  02B8-02BF      Toshiba 1000 - EMS unit I/O #6
  328.  02B0-02DF      EGA (alternate)                       PC   AT
  329.  02C0-02DF      Toshiba 1000 - realtime clock
  330.  02E1           GPIB (adapter 0)                           AT
  331.  02E2-02E3      data acquisition (adapter 0)               AT
  332.  02E8           "industry standard" COM4
  333.  02E8-02EF      Toshiba 1000 - EMS unit I/O #7
  334.  02F8-02FF      serial communications (COM2)          PC   AT         PS2
  335.  0300-031F      prototype card                        PC   AT
  336.  0300-031F      Leading Edge Model D clock            -------------------
  337.  0320-032F      hard disk controller                  PC
  338.  0320           Perstor HD controller, primary        -------------------
  339.  0324           Perstor HD controller, secondary      -------------------
  340.  0340           Sony CD-ROM                           -------------------
  341.  0348-0357      DCA 3278
  342.  0360-0367      PC Network (low address)
  343.  0368-036F      PC Network (high address)                  AT
  344.  0370           Colorado Memory external tape backup control port -------
  345.                 some "second controller" floppy cards -------------------
  346.  0378-037F      parallel printer port                 PC   AT
  347.  0378-037B      parallel printer port                                 PS2
  348.  0380-038F      Eicon Technology Network Adapter (X.25) board (default)
  349.  0380-038F      SDLC, bi-synchronous 2                PC   AT
  350.  0380-0389      BSC communications (alternate)        PC
  351.  0390-039F      Eicon Technology Network Adapter (X.25) board (alternate)
  352.  0390-0393      cluster (adapter 0)                   PC   AT
  353.  03A0-03A9      BSC communications (primary)          PC   AT
  354.  03B0-03BF      monochrome/parallel printer adapter   PC   AT
  355.  03B4-03B5      video subsystem                                       PS2
  356.  03BA           video subsystem                                       PS2
  357.  03BC-03BF      parallel printer port 1                               PS2
  358.  03C0-03CF      Enhanced Graphics Adapter
  359.  03C0-03DA      video subsystem and DAC                               PS2
  360.  03DA           video status register                 AT&T 6300, Olivetti PC
  361.  03D0-03DF      CGA, MCGA, VGA adapter control
  362.  03DE           video mode selector register          AT&T 6300, Olivetti PC
  363.  03E8h          "industry standard" COM3
  364.  03F0-03F7      floppy disk controller                PC   AT         PS2
  365.  03F0           Colorado Memory internal tape backup control port -------
  366.  03F2           DTK high-density XT floppy controller (output only)
  367.  03F5           DTK high-density XT floppy controller
  368.  03F8-03FF      serial communications (COM1)          PC   AT         PS2
  369.  06E2-06E3      data acquisition (adapter 1)               AT
  370.  0790-0793      cluster (adapter 1)                   PC   AT
  371.  0878           Compaq 386SX VGA BIOS relocation           AT
  372.  0AE2-0AE3      data acquisition (adapter 2)               AT
  373.  0B90-0B93      cluster (adapter 2)                   PC   AT
  374.  0EE2-0EE3      data acquisition (adapter 3)               AT
  375.  1390-1393      cluster (adapter 3)                   PC   AT
  376.  22E1           GPIB (adapter 1)
  377.  2390-2393      cluster (adapter 4)                   PC   AT
  378.  4258           LIM EMS 3.1 (not defined in 3.2+)     -------------------
  379.  42E1           GPIB (adapter 2)                           AT
  380.  62E1           GPIB (adapter 3)                           AT
  381.  8258           LIM EMS 3.1 (not defined in 3.2+)     -------------------
  382.  82E1           GPIB (adapter 4)                           AT
  383.  A2E1           GPIB (adapter 5)                           AT
  384.  C258           LIM EMS 3.1 (not defined in 3.2+)     -------------------
  385.  C2E1           GPIB (adapter 6)                           AT
  386.  E2E1           GPIB (adapter 7)                           AT
  387.  
  388. note 1) IOSGA = I/O Support Gate Array
  389.         SSGA = System Support Gate Array
  390.      2) I/O Addresses, hex 000 to 0FF, are reserved for the system board I/O.
  391.         Hex 100 to 3FF are available on the I/O channel.
  392.      3) These are the addresses decoded by the current set of adapter cards.
  393.         IBM may use any of the unlisted addresses for future use.
  394.      4) SDLC Communication and Secondary Binary Synchronous Communications
  395.         cannot be used together because their port addresses overlap.
  396.  
  397.  
  398.  
  399. Reserved Memory Locations ............................................. 2**5
  400.  
  401. ┌──────────────────────────────────────────────────────────────────────────────
  402. │ 000-3FF  - 1k DOS interrupt vector table, 4 byte vectors for ints 00h-0FFh.
  403. │   30:00  - used as a stack area during POST and bootstrap routines. This
  404. │to 3F:FF    stack area may be revectored by an application program.
  405. ├──────────────────────────────────────────────────────────────────────────────
  406. │ ** The BIOS Data Area ** addresses from 400h to 4FFh
  407. ├─────┬───────┬────────────────────────────────────────────────────────────────
  408. │addr.│ size  │                         description
  409. ├─────┼───────┼────────────────────────────────────────────────────────────────
  410. │40:00│  word │ COM1 port address |   These addresses are zeroed out in the
  411. │40:02│  word │ COM2 port address |   OS/2 DOS Compatibility Box if any of
  412. │40:04│  word │ COM3 port address |   the OS/2 COMxx.SYS drivers are loaded.
  413. │40:06│  word │ COM4 port address |
  414. │40:08│  word │ LPT1 port address
  415. │40:0A│  word │ LPT2 port address
  416. │40:0C│  word │ LPT3 port address
  417. │40:0E│  word │ LPT4 port address        (not valid in PS/2 machines)
  418. │40:0E│  word │ PS/2 pointer to 1k extended BIOS Data Area at top of RAM
  419. │40:10│  word │ equipment flag (see int 11h)
  420. └─────┴───────┤ bits:
  421.               │ 0       0       no floppy drive present
  422.               │         1       if floppy drive present (see bits 6&7)
  423.               │ 1       0       no math coprocessor installed
  424.               │         1       if 80x87 installed  (not valid in PCjr)
  425.               │ 2,3     system board RAM   (not used on AT or PS/2)
  426.               │         0,0     16k             0,1     32k
  427.               │         1,0     48k             1,1     64k
  428.               │ 4,5     initial video mode
  429.               │         0,0     no video adapter
  430.               │         0,1     40 column color  (PCjr default)
  431.               │         1,0     80 column color
  432.               │         1,1     MDA
  433.               │ 6,7     number of diskette drives
  434.               │         0,0     1 drive         0,1     2 drives
  435.               │         1,0     3 drives        1,1     4 drives
  436.               │ 8       0       DMA present
  437.               │         1       DMA not present (PCjr, Tandy 1400, Sanyo 55x)
  438.               │ 9,A,B   number of RS232 serial ports
  439.               │ C       game adapter  (joystick)
  440.               │         0       no game adapter
  441.               │         1       if game adapter
  442.               │ D       serial printer (PCjr only)
  443.               │         0       no printer
  444.               │         1       serial printer present
  445.        ┌──────┘ E,F     number of parallel printers installed
  446.        │note 1) The IBM PC and AT store the settings of the system board
  447.        └───┐    switches or CMOS RAM setup information (as obtained by the BIOS
  448.            │    in the Power-On Self Test (POST)) at addresses 40:10h and
  449.            │    40:13h. 00000001b indicates "on", 00000000b is "off".
  450. ┌─────┬────┴──┐
  451. │40:12│  byte │ reserved (PC, AT)
  452. └─────┴───────┤  number of errors detected by infrared keyboard link (PCjr)
  453. ┌─────┬───────┤  POST status (Convertible)
  454. │40:13│  word │ availible memory size in Kbytes (less display RAM in PCjr)
  455. ├─────┼───────┤  this is the value returned by int 12h
  456. │40:15│  word │ reserved
  457. │40:17│  byte │ keyboard flag byte 0 (see int 9h)
  458. └─────┴───────┤ bit 7  insert mode on      3  alt pressed
  459.               │     6  capslock on         2  ctrl pressed
  460.               │     5  numlock on          1  left shift pressed
  461. ┌─────┬───────┤     4  scrollock on        0  right shift pressed
  462. │40:18│  byte │ keyboard flag byte 1 (see int 9h)
  463. └─────┴───────┤ bit 7  insert pressed      3  ctrl-numlock (pause) toggled
  464.               │     6  capslock pressed    2  PCjr keyboard click active
  465.               │     5  numlock pressed     1  PCjr ctrl-alt-capslock held
  466. ┌─────┬───────┤     4  scrollock pressed   0
  467. │40:19│  byte │ storage for alternate keypad entry (not normally used)
  468. │40:1A│  word │ pointer to keyboard buffer head character
  469. │40:1C│  word │ pointer to keyboard buffer tail character
  470. │40:1E│32bytes│ 16 2-byte entries for keyboard circular buffer, read by int 16h
  471. │40:3E│  byte │ drive seek status - if bit=0, next seek will recalibrate by
  472. └─────┴───────┤ repositioning to Track 0.
  473.               │ bit 3  drive D          bit 2  drive C
  474. ┌─────┬───────┤     1  drive B              0  drive A
  475. │40:3F│  byte │ diskette motor status (bit set to indicate condition)
  476. └─────┴───────┤ bit 7  write in progress    3  motor on (floppy 3)
  477.               │     6                       2  motor on (floppy 2)
  478.               │     5                       1  B: motor on (floppy 1)
  479. ┌─────┬───────┤     4                       0  A: motor on (floppy 0)
  480. │40:40│  byte │ motor off counter
  481. │     │       │ starts at 37 and is decremented 1 by each system clock tick.
  482. │     │       │ motor is shut off when count = 0.
  483. │40:41│  byte │ status of last diskette operation     where:
  484. └─────┴───────┤ bit 7 timeout failure                3 DMA overrun
  485.               │     6 seek failure                   2 sector not found
  486.               │     5 controller failure             1 address not found
  487. ┌─────┬───────┤     4 CRC failure                    0 bad command
  488. │40:42│7 bytes│ NEC floppy controller chip status
  489. │40:49│  byte │ Video Control Data Area 1 from 0040:0049 through 0040:0066
  490. └─────┴───────┤ current CRT mode (hex value)
  491.               │    00h 40x25 BW      (CGA)          01h 40x25 color   (CGA)
  492.               │    02h 80x25 BW      (CGA)          03h 80x25 color   (CGA)
  493.               │    04h 320x200 color (CGA)          05h 320x200 BW    (CGA)
  494.               │    06h 640x200 BW    (CGA)          07h monochrome    (MDA)
  495.               │extended video modes (EGA/MCGA/VGA or other)
  496.               │    08h lores,16 color               09h med res,16 color
  497.               │    0Ah hires,4 color                0Bh n/a
  498.               │    0Ch med res,16 color             0Dh hires,16 color
  499. ┌─────┬───────┤    0Eh hires,4 color                0Fh hires,64 color
  500. │40:4A│  word │ number of columns on screen, coded as hex number of columns
  501. └─────┴───────┤ 20 col = 14h  (video mode 8, low res 160x200 CGA graphics)
  502.               │ 40 col = 28h
  503. ┌─────┬───────┤ 80 col = 46h
  504. │40:4C│  word │ screen buffer length in bytes
  505. ├─────┼───────┤(number of bytes used per screen page, varies with video mode)
  506. │40:4E│  word │ current screen buffer starting offset (active page)
  507. │40:50│8 words│ cursor position pages 1-8
  508. └─────┴───────┤ the first byte of each word gives the column (0-19, 39, or 79)
  509. ┌─────┬───────┤ the second byte gives the row (0-24)
  510. │40:60│  byte │ end line for cursor   (normally 1)
  511. │40:61│  byte │ start line for cursor (normally 0)
  512. │40:62│  byte │ current video page being displayed  (0-7)
  513. │40:63│  word │ base port address of 6845 CRT controller or equivalent
  514. ├─────┼───────┤ for active display           3B4h=mono, 3D4h=color
  515. │40:65│  byte │ current setting of the CRT mode register
  516. │40:66│  byte │ current palette mask setting  (CGA)
  517. │40:67│5 bytes│ temporary storage for SS:SP during shutdown (cassette interface)
  518. │40:6C│  word │ timer counter low word
  519. │40:6E│  word │ timer counter high word
  520. │40:69│  byte │ HD_INSTALL (Columbia PCs) (not valid on most clone computers)
  521. └─────┴───────┤ bit  0    0  8 inch external floppy drives
  522.               │           1  5-1/4 external floppy drives
  523.               │      1,2     highest drive address which int 13 will accept
  524.               │              (since the floppy drives are assigned 0-3,subtract
  525.               │              3 to obtain the number of hard disks installed)
  526.               │      4,5     # of hard disks connected to expansion controller
  527.               │      6,7     # of hard disks on motherboard controller
  528.               │              (if bit 6 or 7 = 1, no A: floppy is present and
  529. ┌─────┬───────┤              the maximum number of floppies from int 11 is 3)
  530. │40:70│  byte │ 24 hour timer overflow 1 if timer went past midnight
  531. ├─────┼───────┤ it is reset to 0 each time it is read by int 1Ah
  532. │40:71│  byte │ BIOS break flag (bit 7 = 1 means break key hit)
  533. │40:72│  word │ reset flag
  534. └─────┴───────┤ PCjr keeps 1234h here for softboot when a cartridge is installed
  535.               │ bits 1234h = soft reset, memory check will be bypassed
  536.               │      4321h = preserve memory         (PS/2 only)
  537.               │      5678h = system suspended        (Convertible)
  538.               │      9ABCh = manufacturing test mode (Convertible)
  539. ┌─────┬───────┤      ABCDh = system POST loop mode   (Convertible)
  540. │40:74│  byte │ status of last hard disk operation ; PCjr special disk control
  541. │40:75│  byte │ # of hard disks attached (0-2)     ; PCjr special disk control
  542. │40:76│  byte │ HD control byte; temp holding area for 6th param table entry
  543. │40:77│  byte │ port offset to current hd adapter  ; PCjr special disk control
  544. │40:78│4 bytes│ timeout value for LPT1,LPT2,LPT3,LPT4
  545. │40:7C│4 bytes│ timeout value for COM1,COM2,COM3,COM4 (0-0FFh secs, default 1)
  546. │40:80│  word │ pointer to start of circular keyboard buffer, default 03:1E
  547. │40:82│  word │ pointer to end of circular keyboard buffer, default 03:3E
  548. └─────┴───────┤ note: early Zenith Z183 BIOS set these pointers to zero and
  549. ┌─────┬───────┤       ignored them.
  550. │40:84│  .... │ Video Control Data Area 2, 0040:0084 through 0040:008A
  551. │40:84│  byte │ rows on the screen minus 1 (EGA only)
  552. │40:84│  byte │ PCjr interrupt flag; timer channel 0  (used by POST)
  553. │40:85│  word │ bytes per character (EGA only)
  554. │40:85│2 bytes│ (PCjr only) typamatic character to repeat
  555. │40:86│2 bytes│ (PCjr only) typamatic initial delay
  556. │40:87│  byte │ mode options (EGA only)
  557. └─────┴───────┤ bit 0   0   cursor emulation in effect
  558.               │         1   no cursor emulation
  559.               │     1   0   EGA is connected to a color display
  560.               │         1   EGA is connected to monochrome TTL display
  561.               │     2   0   wait for vertical retrace (CGA active)
  562.               │         1   don't wait for vertical retrace (EGA or MDA active)
  563.               │     3   0   EGA is the active display,
  564.               │         1   "other" display is active.
  565.               │     4       reserved
  566.               │     5,6     EGA memory size
  567.               │             0,0   64k
  568.               │             0,1   128k
  569.               │             1,0   192k
  570.               │             1,1   256k
  571.               │     7   0   don't clear screen on mode changes
  572.               │         1   if the last "set mode" specified not to clear the
  573.               │             video buffer
  574.               │ mode combinations:
  575.               │ bit3  bit1     Meaning
  576.               │   0     0   EGA is active display and is color
  577.               │   0     1   EGA is active display and is monochrome
  578.               │   1     0   EGA is not active, a mono card is active
  579. ┌─────┬───────┤   1     1   EGA is not active, a CGA is active
  580. │40:87│  byte │ (PCjr only) current Fn key code
  581. ├─────┼───────┤             80h bit indicates make/break key code?
  582. │40:88│  byte │ feature bits and switches (EGA only) 0=on, 1=off
  583. └─────┴───────┤ bit 0   switch 1
  584.               │     1   switch 2
  585.               │     2   switch 3
  586.               │     3   switch 4
  587. ┌─────┬───────┤     4-7 feature bits
  588. │40:88│  byte │ (PCjr only) special keyboard status byte
  589. └─────┴───────┤ bit 7 function flag      3 typamatic (0=enable,1=disable)
  590.               │     6 Fn-B break         2 typamatic speed (0=slow,1=fast)
  591.               │     5 Fn pressed         1 extra delay bef.typamatic (0=enable)
  592. ┌─────┬───────┤     4 Fn lock            0 write char, typamatic delay elapsed
  593. │40:89│  byte │ (PCjr) current value of 6845 reg 2 (horizontal synch) used by
  594. └─────┴───────┤ ctrl-alt-cursor screen positioning routine in ROM
  595.               │  (VGA)
  596.               │ bit 0       reserved
  597.               │     1       video summing enabled
  598.               │     2   0   for color monitor attached
  599.               │         1   for mono monitor
  600.               │     3   0   for default palette loading enabled
  601.               │     4   0   for 8x8 text font
  602.               │         1   for 8x16 text font
  603. ┌─────┬───────┤     5-7     reserved
  604. │40:8A│  byte │ (PCjr) CRT/CPU Page Register Image, default 3Fh
  605. └─────┴───────┤ (VGA)  Display Combination Code Index. This is the value
  606.               │  set/returned by function 1Ah of the Video BIOS. This byte
  607.               │  contains an index into the ROM BIOS Display Combination Code
  608.               │  table, which is a list of byte pairs that specify valid
  609.               │  combinations of one or two video subsystems. Video subsystems
  610.               │  are designated by the following values:
  611.               │  00h     no display
  612.               │  01h     MDA with monochrome display
  613.               │  02h     CGA with color display
  614.               │  03h     reserved
  615.               │  04h     EGA with color display
  616.               │  05h     EGA with monochrome display
  617.               │  06h     Professional Graphics Adapter
  618.               │  07h     VGA with analog monochrome display
  619.               │  08h     VGA with analog color display
  620.               │  09h     reserved
  621.               │  0Ah     MCGA with digital color display
  622.               │  0Bh     MCGA with analog monochrome display
  623.               │  0Ch     MCGA with analog color display
  624. ┌─────┬───────┤  0FFh    unrecognized video subsystem
  625. │40:8B│  byte │ last diskette data rate selected
  626. └─────┴───────┤ bit 7,6 starting data transfer rate to use
  627.               │         0,0      500 kb/sec
  628.               │         0,1      300 kb/sec
  629.               │         1,0      250 kb/sec
  630.               │         1,1      reserved
  631.               │     5,4 last step rate selected
  632.               │     3   ending data transfer rate to use
  633.               │     2   reserved
  634.               │     1   reserved
  635.               │     0   1  combination floppy/fixed disk controller detected
  636.               │         0  XT floppy only controller (for 360kb drive) detected
  637.               │                Data Transfer Rates
  638.               │       Kbits/sec     Media   Drive   Sectors/Track
  639.               │         250         360k    360k        9
  640.               │         300         360k    1.2M        9
  641.               │         500         1.2M    1.2M       15
  642.               │         250         720k    720k        9
  643.               │         250         720k    1.4M        9
  644. ┌─────┬───────┤         500         1.4M    1.4M       18
  645. │40:8C│  byte │ hard disk status returned by controller
  646. │40:8D│  byte │ hard disk error returned by controller
  647. │40:8E│  byte │ hard disk interrupt (bit 7=working interrupt)
  648. │40:8F│  byte │ combo_card - status of drives 0 and 1
  649. └─────┴───────┤ bit 7   reserved
  650.               │     6   drive type determined for drive 1
  651.               │     5   drive multiple data rate capability for drive 1
  652.               │         0       no multiple data rate
  653.               │         1       multiple data rate
  654.               │     4   1 then drive 1 has 80 tracks
  655.               │         0 then drive 1 has 40 tracks
  656.               │     3   reserved
  657.               │     2   drive type determined for drive 0
  658.               │     1   drive multiple data rate capability for drive 0
  659.               │         0       no multiple data rate
  660.               │         1       multiple data rate
  661.               │     0   1       the drive 0 has 80 tracks
  662. ┌─────┬───────┤         0       the drive 0 has 40 tracks
  663. │40:90│4 bytes│ media state drive 0, 1, 2, 3
  664. └─────┴───────┤ floppy_media_state
  665.               │ bit 7,6 Data transfer rate
  666.               │         00 - 500 K/sec
  667.               │         01 - 300 K/sec
  668.               │         10 - 250 K/sec
  669.               │         11 - reserved
  670.               │     5   double stepping required
  671.               │     4   media/drive determined
  672.               │     3   reserved
  673.               │     2-0 present state
  674.               │         000  360k in 360k unestablished
  675.               │         001  360k in 1.2M unestablished
  676.               │         010  1.2M in 1.2M unestablished
  677.               │         011  360k in 360k established
  678.               │         100  360k in 1.2M established
  679.               │         101  1.2M in 1.2M established
  680.               │         110  reserved
  681. ┌─────┬───────┤         111  none of the above
  682. │40:94│2 bytes│ track currently seeked to drive 0, 1
  683. │40:96│  byte │ keyboard flag byte 3 (see int 9h)
  684. │40:97│  byte │ keyboard flag byte 2 (see int 9h)
  685. │40:98│ dword │ segment:offset pointer to users wait flag
  686. │40:9C│ dword │ users timeout value in microseconds
  687. │40:A0│  byte │ real time clock wait function in use
  688. └─────┴───────┤ bits 7    wait time elapsed and posted flag
  689.               │      6-1  reserved
  690. ┌─────┬───────┤      0    int 15h, function 86h (WAIT) has occurred
  691. │40:A1│  byte │ LAN A DMA channel flags
  692. │40:A2│2 bytes│ status LAN A 0,1
  693. │40:A4│ dword │ saved hard disk interrupt vector
  694. │40:A8│ dword │ SAVE_PTR: EGA pointer to table of 7 parameters in segment:
  695. └─────┴───────┤           offset format. Format of table:
  696.               │ D_1 dword   pointer to 1472 byte table of 64 video parameters
  697.               │ D_2 dword   reserved
  698.               │ D_3 dword   reserved
  699.               │ D_4 dword   reserved
  700.               │ D_5 dword   reserved for future use
  701.               │ D_6 dword   reserved for future use
  702. ┌─────┬───────┤ D_7 dword   reserved for future use
  703. │40:B0│2 words│ international support                   (Tandy 1000 TX)
  704. │40:B4│  byte │ keyboard NMI control flags              (Convertible)
  705. │40:B4│  byte │ monochrome monitor hookup detect        (Tandy 1000 TX)
  706. │     │       │ 00h not present   0FFh  present
  707. │40:B5│ dword │ keyboard break pending flags            (Convertible)
  708. │40:B5│  byte │ extended equipment detect  (5 bits)     (Tandy 1000 TX)
  709. └─────┴───────┤ bit 0 = 0   drive A is 5¼
  710.               │         1   drive A is 3½
  711.               │     1 = 0   drive A is 5¼
  712.               │         1   drive A is 3½
  713.               │     2 = 0   Tandy 1000 keyboard layout
  714.               │         1   IBM keyboard layout
  715.               │     3 = 0   CPU slow mode
  716.               │         1   CPU fast mode
  717.               │     4 = 0   internal color video support enabled
  718.               │         1   internal color video support disabled, external
  719.               │             video enabled (chg from mb'd to expansion card)
  720.               │     5 = 0   no external monochrome video installed
  721. ┌─────┬───────┤         1   external monochrome video installed
  722. │40:B6│  byte │ extended equipment detect  (1 bit)      (Tandy 1000 TX)
  723. └─────┴───────┤ bit 0 = 0   drive C is 5¼
  724. ┌─────┬───────┤         1   drive C is 3½
  725. │40:B9│  byte │ port 60 single byte queue               (Convertible)
  726. │40:BA│  byte │ scan code of last key                   (Convertible)
  727. │40:BB│  byte │ pointer to NMI buffer head              (Convertible)
  728. │40:BC│  byte │ pointer to NMI buffer tail              (Convertible)
  729. │40:BD│16bytes│ NMI scan code buffer                    (Convertible)
  730. │40:CE│  word │ day counter                             (Convertible and after)
  731. │  to │ -04:8F│               end of BIOS Data Area
  732. ├─────┴───────┴────────────────────────────────────────────────────────────────
  733. │ ** End of BIOS Data Area **
  734. ├─────┬───────┬────────────────────────────────────────────────────────────────
  735. │40:90│-40:EF │ reserved by IBM
  736. │40:F0│16bytes│ Inter-Application Communications Area (for use by applications
  737. │40:FF│       │ to transfer data or parameters to each other)
  738. └─────┴───────┤ 1) Used by Turbo Power's FMARK (mark memory for TSRs).
  739.               │ 2) Used by Norton Utilities' TimeMark to store the time.
  740.               │ 3) Used by BRIEF editor.
  741. ┌─────┬───────┤
  742. │50:00│ byte  │ DOS print screen status flag
  743. └─────┴───────┤        00h    not active or successful completion
  744.               │        01h    print screen in progress
  745. ┌─────┬───────┤        0FFh   error during print screen operation
  746. │50:01│       │ Used by BASIC
  747. │50:02-03     │ PCjr POST and diagnostics work area
  748. │50:04│  byte │ Single drive mode status byte - not used by AT&T DOS 2.11!
  749. └─────┴───────┤         00     logical drive A was last active
  750. ┌─────────────┤         01     logical drive B was last active
  751. │50:05-0E     │ PCjr POST and diagnostics work area
  752. │50:0F│       │ BASIC: SHELL flag (set to 02h if there is a current SHELL)
  753. │50:10│  word │ BASIC: segment address storage (set with DEF SEG)
  754. │50:12│4 bytes│ BASIC: int 1Ch clock interrupt vector segment:offset storage
  755. │50:16│4 bytes│ BASIC: int 23h ctrl-break interrupt segment:offset storage
  756. │50:1A│4 bytes│ BASIC: int 24h disk error int vector segment:offset storage
  757. │50:1B-1F     │ Used by BASIC for dynamic storage
  758. │50:20-21     │ Used by DOS for dynamic storage
  759. │50:22-2C     │ Used by DOS for diskette parameter table. See int 1Eh for values
  760. └─────┴───────┤ In DOS 1.0 this is located in the ROM BIOS, but in DOS 1.1 and
  761.               │ subsequent it is a part of DOS located at 05:22. The first byte
  762.               │ (out of eleven) of the Disk Parameter contains the hexadecimal
  763.               │ value CF in DOS 1.0 and DF in DOS 1.1 and later.
  764.               │ DOS 1.0   24ms
  765. ┌─────────────┤ DOS 1.1   26ms
  766. │50:30-33     │ Used by MODE command
  767. │50:81│       │ number of floppies installed in the system?
  768. │50:82│       │ first hard disk drive?
  769. │50:83│       │ last hard disk drive?
  770. │50:34-FF     │ Unknown - Reserved for DOS
  771. └─────────────┴─────────────────────────────────────────────────────────────────
  772.  
  773.  
  774.  
  775. Absolute Addresses .................................................... 2**6
  776.  
  777. 0008:0047 IO.SYS or IBMBIO.COM IRET instruction. This is the dummy routine that
  778.           interrupts 01h, 03h, and 0Fh are initialized to during POST.
  779. C000:001E EGA BIOS signature (the letters IBM)
  780. F000:FA6E table of characters 00h-7Fh used by int 10h video BIOS
  781.           The first 128 characters are stored here and each occupies 8 bytes.
  782.           The high bit ones are somewhere on the video adapter card.
  783. F000:FFF5 BIOS release date
  784. F000:FFFE PC model identification
  785.  
  786.      ┌─────────────────────────────────────────────────────────────────────┐
  787.      │ ROM BIOS    ┌ model byte                                            │
  788.      │ copyright   │    ┌ submodel byte          machine                   │
  789.      │   date      │    │    ┌ revision                                    │
  790.      ├──────────┼────┼────┼────┼───────────────────────────────────────────┤
  791.      │          │ 00 │ 00 │ 00 │ AT&T 6300, Olivetti PC                    │
  792.      │ 09/02/86 │ FA │ 00 │ 00 │ PS/2 Model 30                             │
  793.      │ 01/10/86 │ FB │ 00 │ 00 │ XT-2 (early)                              │
  794.      │ 01/10/86 │ FB │ 00 │ 01 │ XT Model 089                              │
  795.      │ 05/09/86 │ FB │ 01 │ 02 │ XT-2 (revised)                            │
  796.      │ 01/10/84 │ FC │ -- │ -- │ AT Model 099 (original)                   │
  797.      │ 06/10/85 │ FC │ 00 │ 01 │ AT Model 239 6mHz      (6.6 max governor) │
  798.      │ 11/15/85 │ FC │ 01 │ 00 │ AT Model 339, 339 8mHz (8.6 max governor) │
  799.      │          │ FC │ 01 │ 00 │ Compaq 386/16                             │
  800.      │          │ FC │ 01 │ 03 │ some Phoenix 386 BIOS                     │
  801.      │          │ FC │ 01 │ 81 │ some Phoenix 386 BIOS                     │
  802.      │ 04/21/86 │ FC │ 02 │ 00 │ XT/286                                    │
  803.      │ 02/13/87 │ FC │ 04 │ 00 │ PS/2 Model 50                             │
  804.      │ 02/13/87 │ FC │ 05 │ 00 │ PS/2 Model 60                             │
  805.      │          │ FC │ 00 │    │ 7531/2 Industrial AT                      │
  806.      │          │ FC │ 06 │    │ 7552 "Gearbox"                            │
  807.      │ 04/18/88 │ FC │ 04 │ 03 │ PS/2 50Z                                  │
  808.      │ 01/24/90 │ FC │ 01 │ 00 │ Compaq Deskpro 80386/25e                  │
  809.      │ 10/02/89 │ FC │ 02 │ 00 │ Compaq Deskpro 386s, 386SX, 16mHz         │
  810.      │ 06/01/83 │ FD │ -- │ -- │ PCjr                                      │
  811.      │ 11/08/82 │ FE │ -- │ -- │ XT, Portable PC, XT/370, 3270PC           │
  812.      │ 04/24/81 │ FF │ -- │ -- │ PC-0             (16k motherboard)        │
  813.      │ 10/19/81 │ FF │ -- │ -- │ PC-1             (64k motherboard)        │
  814.      │ 08/16/82 │ FF │ -- │ -- │ PC, XT, XT/370   (256k motherboard)       │
  815.      │ 10/27/82 │ FF │ -- │ -- │ PC, XT, XT/370   (256k motherboard)       │
  816.      │   ? 1987 │ F8 │ 00 │ 00 │ PS/2 Model 80                             │
  817.      │  3/30/87 │ F8 │ 00 │ 00 │ PS/2 Model 80-041  16mHz                  │
  818.      │ 08/28/87 │ F8 │ ?? │ ?? │ PS/2 Model 80-071  16mHz                  │
  819.      │   ? 1987 │ F8 │ 01 │ 00 │ PS/2 Model 80      20mHz                  │
  820.      │ 09/17/87 │ F8 │ 01 │ 01 │ PS/2 Model 80-111  20mHz                  │
  821.      │        ? │ F8 │ 04 │  ? │ PS/2 Model 70-121                         │
  822.      │ 01/18/89 │ F8 │ 0B │ 00 │  PS/2 Model 70 Portable                   │
  823.      │ 04/11/88 │ F8 │ 09 │ 02 │  PS/2 Model 70 desktop                    │
  824.      │ 02/20/89 │ F8 │ 0D │    │  PS/2 Model 70-A21                        │
  825.      │ 09/13/85 │ F9 │ 00 │ 00 │ Convertible                               │
  826.      │          │ 2D │ -- │ -- │ Compaq PC        (4.77mHz original)       │
  827.      │          │ 9A │ -- │ -- │ Compaq Plus      (XT compatible)          │
  828.      └──────────┴────┴────┴────┴───────────────────────────────────────────┘
  829.  
  830.  
  831.  
  832. The IBM PC System Interrupts (Overview) ............................... 2**7
  833.  
  834.  The interrupt table is stored in the very lowest location in memory, starting
  835. at 0000:0000h. The locations are offset from segment 0, i.e. location 0000h has
  836. the address for int 0, etc. The table is 1024 bytes in length and contains 256
  837. four byte vectors from 00h to 0FFh. Each address' location in memory can be
  838. found by multiplying the interrupt number by 4. For example, int 7 could be
  839. found by (7x4=28) or 1Bh (0000:001Bh).
  840.  
  841.  These interrupt vectors normally point to ROM tables or are taken over by DOS
  842. when an application is run. Some applications revector these interrupts to
  843. their own code to change the way the system responds to the user. DOS provides
  844. int 21h function 25h to change interrupts from a high level; altering the
  845. interrupt vector table directly is not recommended, nor would it really get
  846. you anywhere.
  847.  
  848.  
  849. Quick Chart of Interrupts 00h-0FFh .................................... 2**8
  850.  
  851. ┌─────────────────────┬────────────────────────────────────────────────────────┐
  852. │  Interrupt Address  │                                                        │
  853. ├───────┬───────┬─────┘                        Function                        │
  854. │ Number│ (Hex) │ Type                                                         │
  855. ├───────┼───────┼─────┬────────────────────────────────────────────────────────┤
  856. │   0   │ 00-03 │ CPU │  Divide by Zero                                        │
  857. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  858. │   1   │ 04-07 │ CPU │  Single Step                                           │
  859. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  860. │   2   │ 08-0B │ CPU │  Nonmaskable                                           │
  861. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  862. │   3   │ 0C-0F │ CPU │  Breakpoint                                            │
  863. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  864. │   4   │ 10-13 │ CPU │  Overflow                                              │
  865. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  866. │   5   │ 14-17 │ BIOS│  Print Screen                                          │
  867. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  868. │   6   │ 18-1B │ hdw │  Reserved                                              │
  869. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  870. │   7   │ 1C-1F │ hdw │  Reserved                                              │
  871. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  872. │   8   │ 20-23 │ hdw │  Time of Day                                           │
  873. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  874. │   9   │ 24-27 │ hdw │  Keyboard                                              │
  875. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  876. │   A   │ 28-2B │ hdw │  Reserved                                              │
  877. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  878. │   B   │ 2C-2F │ hdw │  Communications (8259)                                 │
  879. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  880. │   C   │ 30-33 │ hdw │  Communications                                        │
  881. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  882. │   D   │ 34-37 │ hdw │  Disk                                                  │
  883. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  884. │   E   │ 38-3B │ hdw │  Diskette                                              │
  885. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  886. │   F   │ 3C-3F │ hdw │  Printer                                               │
  887. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  888. │   10  │ 40-43 │ BIOS│  Video                                                 │
  889. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  890. │   11  │ 44-47 │ BIOS│  Equipment Check                                       │
  891. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  892. │   12  │ 48-4B │ BIOS│  Memory                                                │
  893. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  894. │   13  │ 4C-4F │ BIOS│  Diskette/Disk                                         │
  895. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  896. │   14  │ 50-53 │ BIOS│  Serial Communications                                 │
  897. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  898. │   15  │ 54-57 │ BIOS│  Cassette, System Services                             │
  899. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  900. │   16  │ 58-5B │ BIOS│  Keyboard                                              │
  901. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  902. │   17  │ 5C-5F │ BIOS│  Parallel Printer                                      │
  903. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  904. │   18  │ 60-63 │ BIOS│  ROM BASIC Loader                                      │
  905. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  906. │   19  │ 64-67 │ BIOS│  Bootstrap Loader                                      │
  907. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  908. │   1A  │ 68-6B │ BIOS│  Time of Day                                           │
  909. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  910. │   1B  │ 6C-6F │ BIOS│  Keyboard Break                                        │
  911. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  912. │   1C  │ 70-73 │ BIOS│  Timer Tick                                            │
  913. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  914. │   1D  │ 74-77 │ BIOS│  Video Initialization                                  │
  915. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  916. │   1E  │ 78-7B │ BIOS│  Diskette Parameters                                   │
  917. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  918. │   1F  │ 7C-7F │ BIOS│  Video Graphics Characters, second set                 │
  919. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  920. │   20  │ 80-83 │ DOS │  General Program Termination                           │
  921. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  922. │   21  │ 84-87 │ DOS │  DOS Services Function Request                         │
  923. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  924. │   22  │ 88-8B │ DOS │  Called Program Termination Address                    │
  925. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  926. │   23  │ 8C-8F │ DOS │  Control Break Termination Address                     │
  927. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  928. │   24  │ 90-93 │ DOS │  Critical Error Handler                                │
  929. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  930. │   25  │ 94-97 │ DOS │  Absolute Disk Read                                    │
  931. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  932. │   26  │ 98-9B │ DOS │  Absolute Disk Write                                   │
  933. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  934. │   27  │ 9C-9F │ DOS │  Terminate and Stay Resident                           │
  935. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  936. │ 28-3F │ A0-FF │ DOS │  Reserved for DOS                                      │
  937. └───────┴───────┴─────┼────────────────────────────────────────────────────────┤
  938.                       │ *29h   Fast Screen Write                               │
  939.                       │ *2Ah   Microsoft Networks - Session Layer Interrupt    │
  940.                       │  2Fh   Multiplex Interrupt                             │
  941.                       │ *30h   Far jump instruction for CP/M-style calls       │
  942.                       │  33h   Used by Microsoft Mouse Driver                  │
  943. ┌───────┬───────┬─────┼────────────────────────────────────────────────────────┤
  944. │ 40-43 │100-115│ BIOS│  Reserved for BIOS                                     │
  945. └───────┴───────┴─────┼────────────────────────────────────────────────────────┤
  946.                       │  40h   Hard Disk BIOS                                  │
  947.                       │  41h   Hard Disk Parameters  (except PC1)              │
  948.                       │  42h   Pointer to screen BIOS entry  (EGA, VGA, PS/2)  │
  949.                       │  43h   Pointer to EGA initialization parameter table   │
  950. ┌───────┬───────┬─────┼────────────────────────────────────────────────────────┤
  951. │   44  │116-119│ BIOS│  First 128 Graphics Characters                         │
  952. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  953. │ 45-47 │120-131│ BIOS│  Reserved for BIOS                                     │
  954. └───────┴───────┴─────┼────────────────────────────────────────────────────────┤
  955.                       │  45h   Reserved by IBM  (not initialized)              │
  956.                       │  46h   Pointer to hard disk 2 params (AT, PS/2)        │
  957.                       │  47h   Reserved by IBM  (not initialized)              │
  958. ┌───────┬───────┬─────┼────────────────────────────────────────────────────────┤
  959. │   48  │132-135│ BIOS│  PCjr Cordless Keyboard Translation                    │
  960. ├───────┼───────┼─────┼────────────────────────────────────────────────────────┤
  961. │   49  │136-139│ BIOS│  PCjr Non-Keyboard Scancode Translation Table          │
  962. └───────┴───────┴─────┼────────────────────────────────────────────────────────┤
  963.                       │  4Ah   Real-Time Clock Alarm (Convertible, PS/2)       │
  964. ┌───────┬───────┬─────┼────────────────────────────────────────────────────────┤
  965. │ 50-5F │140-17F│ BIOS│  Reserved for BIOS                                     │
  966. └───────┴───────┴─────┼────────────────────────────────────────────────────────┤
  967.                       │  5Ah   Cluster Adapter BIOS entry address              │
  968.                       │ *5Bh   IBM  (cluster adapter?)                         │
  969.                       │  5Ch   NETBIOS interface entry port                    │
  970. ┌───────┬───────┬─────┴────────────────────────────────────────────────────────┤
  971. │ 60-67 │180-19F│  User Program Interrupts (availible for general use)         │
  972. └───────┴───────┴─────┬────────────────────────────────────────────────────────┤
  973.                       │  60h   10-Net Network                                  │
  974.                       │  67h   Used by LIM & AQA EMS, EEMS                     │
  975. ┌───────┬───────┬─────┴────────────────────────────────────────────────────────┤
  976. │ 68-7F │1A0-1FF│  Reserved by IBM                                             │
  977. └───────┴───────┴─────┬────────────────────────────────────────────────────────┤
  978.                       │  6Ch   System Resume Vector (Convertible)              │
  979.                       │  6Fh   some Novell and 10-Net API functions            │
  980.                       │  70h   IRQ 8, Real Time Clock Interrupt (AT, PS/2)     │
  981.                       │  71h   IRQ 9, LAN Adapter 1                            │
  982.                       │  72h   IRQ 10  (AT, XT/286, PS/2)  Reserved            │
  983.                       │  73h   IRQ 11  (AT, XT/286, PS/2)  Reserved            │
  984.                       │  74h   IRQ 12  Mouse Interrupt (PS/2)                  │
  985.                       │  75h   IRQ 13, Coprocessor Error                       │
  986.                       │  76h   IRQ 14, Hard Disk Controller (AT, PS/2)         │
  987.                       │  77h   IRQ 15 (AT, XT/286, PS/2)  Reserved             │
  988.                       │  7Ch   IBM REXX88PC command language                   │
  989. ┌───────┬───────┬─────┴────────────────────────────────────────────────────────┤
  990. │ 80-85 │200-217│  ROM BASIC                                                   │
  991. ├───────┼───────┼──────────────────────────────────────────────────────────────┤
  992. │ 86-F0 │218-3C3│  Used by BASIC Interpreter When BASIC is running             │
  993. ├───────┼───────┼──────────────────────────────────────────────────────────────┤
  994. │ F1-FF │3C4-3FF│  Reserved by IBM                                             │
  995. └───────┴───────┴──────┬───────────────────────────────────────────────────────┤
  996.                        │ *0F8h  Set Shell Interrupt (OEM)                      │
  997.                        │ *0F9h  OEM SHELL service codes                        │
  998.                        └───────────────────────────────────────────────────────┘
  999.  
  1000.  
  1001.  
  1002. The IBM-PC System Interrupts (in detail) .............................. 2**9
  1003.  
  1004. ┌─────────────────────────────────────────────────────────────────────────────┐
  1005. │Interrupt  00h Divide by Zero                                                │
  1006. └─────────────────────────────────────────────────────────────────────────────┘
  1007. (0:0000h) (processor error). Automatically called at end of DIV or IDIV
  1008.           operation that results in error. Normally set by DOS to display an
  1009.           error message and abort the program.
  1010.  
  1011. note    On an 8086/8088, the return address points to the following instruction
  1012.         On an 80286/80386, the return address points to the divide instruction
  1013.  
  1014.  
  1015. ┌─────────────────────────────────────────────────────────────────────────────┐
  1016. │Interrupt  01h Single step                                                   │
  1017. └─────────────────────────────────────────────────────────────────────────────┘
  1018. (0:0004h) Taken after every instruction when CPU Trap Flag indicates
  1019.           single-step mode (bit 8 of FLAGS is 1). This is what makes the "T"
  1020.           command of DEBUG work for single stepping. Is not generated after MOV
  1021.           to segment register or POP of segment register. (unless you have a
  1022.           very early 8088 with the microcode bug).
  1023.  
  1024.  
  1025. ┌─────────────────────────────────────────────────────────────────────────────┐
  1026. │Interrupt  02h Non-maskable interrupt                                        │
  1027. └─────────────────────────────────────────────────────────────────────────────┘
  1028. (0:0008h)       Vector not disabled via CLI. Generated by NMI signal in
  1029.                 hardware. This function is called in the event of a memory
  1030.                 parity error or may occur in the event of other hardware
  1031.                 problems or failures depending on the specific manufacturer's
  1032.                 hardware. Displays the appropriate error message and halts the
  1033.                 processor.
  1034.                  Some AT chip sets apparently use int 02h to signal I/O errors
  1035.                 as well as parity errors.
  1036.  
  1037.                 This signal has various uses:
  1038.         POST parity error:                  all except PCjr and Convertible
  1039.         80x87 coprocessor interrupt:        all except PCjr and Convertible
  1040.         Keyboard interrupt:                 PCjr, Convertible
  1041.         I/O channel check:                  Convertible, PS/2 50+
  1042.         Disk controller power-on request:   Convertible
  1043.         System suspend:                     Convertible
  1044.         Realtime clock:                     Convertible
  1045.         System watchdog timer:              PS/2 50+
  1046.         Timeout interrupt:                  PS/2 50+
  1047.         DMA timer time-out interrupt:       PS/2 50+
  1048.         Infrared keyboard link:             PCjr
  1049.  
  1050.  
  1051. ┌─────────────────────────────────────────────────────────────────────────────┐
  1052. │Interrupt  03h Breakpoint                                                    │
  1053. └─────────────────────────────────────────────────────────────────────────────┘
  1054. (0:000Ch)  Taken when CPU executes the 1-byte int 3 (0CCh). Similar to 8080's
  1055.  
  1056. (internal) RST instruction. Generally used to set breakpoints for DEBUG.
  1057.  
  1058. note 1)  Also used by Turbo Pascal versions 1,2,3 when {$U+} specified.
  1059.      2)  Int 3s are sometimes inserted by the Microsoft Linker in response to
  1060.          an unresolved symbol.
  1061.  
  1062.  
  1063. ┌─────────────────────────────────────────────────────────────────────────────┐
  1064. │Interrupt  04h Divide overflow                                               │
  1065. └─────────────────────────────────────────────────────────────────────────────┘
  1066. (0:0010h)  Generated by INTO instruction if OF flag is set. If flag is not set,
  1067.  
  1068. (internal) INTO is effectively a NOP. Used to trap any arithmetic errors when
  1069.            program is ready to handle them rather than immediately when they
  1070.            occur.
  1071.  
  1072.  
  1073. ┌─────────────────────────────────────────────────────────────────────────────┐
  1074. │Interrupt  05h Print Screen                                                  │
  1075. └─────────────────────────────────────────────────────────────────────────────┘
  1076. (0:0014h)  Service dumps the screen to the printer. Invoked by int 9 for shifted
  1077.            key 55 (PrtSc). Automatically called by keyboard scan when PrtSc key
  1078.            is pressed. Normally executes a routine to print the screen, but may
  1079.            call any routine that can safely be executed from inside the keyboard
  1080.            handler. Status and result byte are at address 0050:0000.
  1081.  
  1082. (internal) BOUND Check Failed (80286+)
  1083.            Generated by BOUND instruction when the value to be tested is less
  1084.            than the indicated lower bound or greater than the indicated upper
  1085.            bound.
  1086.  
  1087. entry   AH      05h
  1088. return  absolute address 50:0
  1089.         00h     print screen has not been called, or upon return from a call
  1090.                 there were no errors
  1091.         01h     print screen is already in progress
  1092.         0FFh    error encountered during printing
  1093. note 1) Uses BIOS services to read the screen.
  1094.      2) Output is directed to LPT1.
  1095.      3) Revectored into GRAPHICS.COM if GRAPHICS.COM is loaded.
  1096.      4) On the Tandy 1000TX this interrupt can be enabled or disabled across
  1097.         the expansion slots via a DIP switch.
  1098.  
  1099.  
  1100. ┌─────────────────────────────────────────────────────────────────────────────┐
  1101. │Interrupt  06h Reserved by IBM                                               │
  1102. └─────────────────────────────────────────────────────────────────────────────┘
  1103. (0:0018h)
  1104.         On the Tandy 1000TX this interrupt can be enabled or disabled across
  1105.         the expansion slots via a DIP switch.
  1106.  
  1107. (internal) Undefined Opcode (80286+)
  1108.  
  1109.  
  1110.  
  1111. ┌─────────────────────────────────────────────────────────────────────────────┐
  1112. │Interrupt  07h Reserved by IBM                                               │
  1113. └─────────────────────────────────────────────────────────────────────────────┘
  1114. (0:00C0h)
  1115.         On the Tandy 1000TX this interrupt can be enabled or disabled across
  1116.         the expansion slots via a DIP switch.
  1117.  
  1118. (internal) No Math Unit Available (80286+)
  1119.  
  1120. note    The 80286 and later can be programmed to generate an int 7 whenever
  1121.         an ESC instruction is encountered. This could be used to emulate an
  1122.         80x87 series coprocessor in software and be transparent to the
  1123.         application software. It could also be used to make a non-Intel
  1124.         floating point processor emulate an 80x87.
  1125.  
  1126.  
  1127.  
  1128. ┌─────────────────────────────────────────────────────────────────────────────┐
  1129. │Interrupt  08h Timer                                                         │
  1130. └─────────────────────────────────────────────────────────────────────────────┘
  1131. (0:0020h)  55ms timer "tick" issued 18.2 times per second.
  1132.  (IRQ0)    8259-1 Interrupt Controller
  1133.            Updates the system time at [0040:006C] (low word) and [0040:006E]
  1134.            (high word) and issues an int 1Ch (timer). (int 1Ch points to an
  1135.            IRET instruction unless changed by a resident program). The timer
  1136.            interrupt is given the highest maskable interrupt priority upon
  1137.            power up.
  1138.  
  1139. (internal) Double Fault (80286+ protected mode) Called when multiple exceptions
  1140.            occur on one instruction, or an exception occurs in an exception
  1141.            handler. If an exception occurs in the double fault handler, the CPU
  1142.            goes into SHUTDOWN mode (which circuitry in the PC/AT converts to a
  1143.            reset).
  1144.  
  1145. entry   AH      08h
  1146. return  absolute addresses:
  1147.         40:6C   number of interrupts since power on (4 bytes)
  1148.         40:70   number of days since power on       (1 byte)
  1149.         40:67   day counter on all products after AT
  1150.         40:40   motor control count - gets decremented and shuts off diskette
  1151.                 motor if zero
  1152.  
  1153.  
  1154.  
  1155. ┌─────────────────────────────────────────────────────────────────────────────┐
  1156. │Interrupt  09h Keyboard                                                      │
  1157. └─────────────────────────────────────────────────────────────────────────────┘
  1158. (0:0024h)  Taken whenever a key is pressed or released. This is normally a scan
  1159.  (IRQ1)    code, but may also be an ACK or NAK of a command on AT-type
  1160.            keyboards. The hardware provides the key pressed in a non-ASCII scan
  1161.            code format read at I/O port 60h. The servicer acknowledges receipt
  1162.            of the key by toggling bit 7 of port 61h. (Port 61h should be read
  1163.            first, then bit 7 ORed on, output to port 61h, then ANDed off, and
  1164.            resent to port 61h).
  1165.  
  1166.             The read key is decoded to yield an ASCII character, special
  1167.            function key (such as F1) or a control function like Left Shift Key.
  1168.            The converted ASCII character is placed into the next available
  1169.            position in the circular queue keyboard. It is put in the position
  1170.            indicated by queue tail when it will not cause the loss of earlier
  1171.            entered data. The queue head points to the oldest key pressed in the
  1172.            buffer which has not been removed from the queue (the normal process
  1173.            uses int 16h to remove keys from the queue and return the key value
  1174.            to the int 16h caller).
  1175.  
  1176.             The 16 word queue holds up to 16 keys. If the queue head equals the
  1177.             queue tail, the queue is empty. Valid keys in the queue comprise
  1178.             the upper byte scan code and the lower byte ASCII character. If the
  1179.             key pressed has no ASCII equivalent (i.e F1 to F12), the lower byte
  1180.             is zero.
  1181.  
  1182.              Toggle and shift keys are not placed in the buffer, but appear in
  1183.            the two status bytes at absolute addr. [0040:0017,18].
  1184.  
  1185.            Special key combinations will cause other events to occur:
  1186.            a) Ctrl-Alt_Del  -  Reset computer by jumping to power_on_reset
  1187.            b) Print screen  -  Call int_5_prn_scrn to print the current screen
  1188.            c) Ctrl-Break    -  Call int_1Bh control break key processor (DOS)
  1189.            d) Pause         -  Wait until an ASCII key is pressed, without
  1190.                                placing the key in the queue
  1191.  
  1192. (internal) Math Unit Protection Fault (80286+ protected mode)
  1193.  
  1194. entry   AH      09h
  1195. return  at absolute memory addresses:
  1196.         40:17   bit
  1197.                 0       right shift key depressed
  1198.                 1       left shift key depressed
  1199.                 2       control key depressed
  1200.                 3       alt key depressed
  1201.                 4       ScrollLock state has been toggled
  1202.                 5       NumLock state has been toggled
  1203.                 6       CapsLock state has been toggled
  1204.                 7       insert state is active
  1205.         40:18   bit
  1206.                 0       left control key depressed
  1207.                 1       left alt key depressed
  1208.                 2       SysReq key depressed
  1209.                 3       Pause key has been toggled
  1210.                 4       ScrollLock key is depressed
  1211.                 5       NumLock key is depressed
  1212.                 6       CapsLock key is depressed
  1213.                 7       Insert key is depressed
  1214.         40:96   bit
  1215.                 0       last code was the E1h hidden code
  1216.                 1       last code was the E0h hidden code
  1217.                 2       right control key down
  1218.                 3       right alt key down
  1219.                 4       101 key Enhanced keyboard installed
  1220.                 5       force NumLock if rd ID & kbx
  1221.                 6       last character was first ID character
  1222.                 7       doing a read ID (must be bit 0)
  1223.         40:97   bit
  1224.                 0       ScrollLock indicator
  1225.                 1       NumLock indicator
  1226.                 2       CapsLock indicator
  1227.                 3       circus system indicator
  1228.                 4       ACK received
  1229.                 5       resend received flag
  1230.                 6       mode indicator update
  1231.                 7       keyboard transmit error flag
  1232.         40:1E   keyboard buffer (20h bytes)
  1233.         40:1C   buffer tail pointer
  1234.         40:72   1234h if ctrl-alt-del pressed on keyboard
  1235.      AL   scan code
  1236. note 1) Int 05h invoked if PrtSc key pressed.
  1237.      2) Int 1Bh invoked if Ctrl-Break key sequence pressed.
  1238.      3) Int 15h, AH=85h invoked on AT and after if SysReq key is pressed.
  1239.      4) Int 15h, AH=4Fh invoked on machines after AT.
  1240.      5) Int 16h, BIOS keyboard functions, uses this interrupt.
  1241.  
  1242.  
  1243. ┌─────────────────────────────────────────────────────────────────────────────┐
  1244. │Interrupt  0Ah  EGA Vertical Retrace                                         │
  1245. └─────────────────────────────────────────────────────────────────────────────┘
  1246. (0:0028h)  used by EGA vertical retrace
  1247.  (IRQ2)    8259-1 Interrupt Controller
  1248. note 1) The TOPS and PCnet adapters use this IRQ line by default.
  1249.      2) On systems equipped with 2 interrupt controller chips (8259), IRQ 2
  1250.         is used to support the second interrupt controller. In this case,
  1251.         int 71h (IRQ 9) is used to replace IRQ 2. Hardware calls to int 71h
  1252.         are redirected to this interrupt to maintain compatibility.
  1253.      3) Many VGA boards to not use this interrupt.
  1254.  
  1255. (internal) Invalid Task State Segment (80286+ protected mode)
  1256.  
  1257.  
  1258.  
  1259. ┌─────────────────────────────────────────────────────────────────────────────┐
  1260. │Interrupt  0Bh  Communications Controller (serial port) hdw. entry           │
  1261. └─────────────────────────────────────────────────────────────────────────────┘
  1262. (0:002Ch)  Serial Port 2 (COM2) 8259-1
  1263.  (IRQ3)
  1264. note 1) IRQ 3 may be used by SDLC (synchronous data-link control) or
  1265.         bisynchronous communications cards instead of a serial port.
  1266.      2) The TOPS and PCnet adapters use this interrupt request line as an
  1267.         alternate.
  1268.      3) On PS/2s, COM2 through COM8 share this IRQ.
  1269.      4) For most serial boards, COM4 shares this IRQ.
  1270.      5) On the Commodore Amiga 2000 with the PC Bridge Board, this interrupt
  1271.         is used for communication between the Amiga system board and the
  1272.         Bridge Board. This was probably the lowest IRQ level they felt safe
  1273.         using, but limits the A2000's use of network cards, etc.
  1274.      6) This interrupt is used by part of the stack-switching code added
  1275.         to DOS 3.2 for use with Local Area Network adapters.
  1276.      7) The PS/2 puts COM3 through COM8 at port addresses above 3FFh (not
  1277.         properly decoded by older PCs) and has all of them sharing IRQ3.
  1278.  
  1279. (internal) Not Present (80286+ protected mode)
  1280.            Generated when loading a segment register if the segment descriptor
  1281.            indicates that the segment is not currently in memory. May be used
  1282.            to implement virtual memory.
  1283.  
  1284.  
  1285. ┌─────────────────────────────────────────────────────────────────────────────┐
  1286. │Interrupt  0Ch  Communications Controller (serial port) Hardware Entry       │
  1287. └─────────────────────────────────────────────────────────────────────────────┘
  1288. (0:0030h)  Serial Port 1 (COM1) or internal modem in PCjr or Convertible
  1289.  (IRQ4)    8259-1
  1290. note 1) IRQ 4 may be used by SDLC (synchronous data-link control) or
  1291.         bisynchronous communications cards instead of a serial port.
  1292.      2) On some PCs, this interrupt is shared by COM3.
  1293.      3) Tandy computers use IRQ4 instead of IRQ5 for the hard disk interrupt.
  1294.      4) Best performance of mice sometimes happens when they are configured
  1295.         for IRQ4 instead of IRQ3, since some mouse drivers may lock system
  1296.         interrupts for long periods.
  1297.  
  1298. (internal) Stack Fault (80286+ protected mode)
  1299.            Generated on stack overflow/underflow. Note that the 80286 will shut
  1300.            down in real mode if SP=1 before a push.
  1301.  
  1302.  
  1303. ┌─────────────────────────────────────────────────────────────────────────────┐
  1304. │Interrupt  0Dh  Hard Disk                                                    │
  1305. └─────────────────────────────────────────────────────────────────────────────┘
  1306. (0:0034h)  Miscelleneous uses
  1307.  (IRQ5)    8259-1
  1308. note 1) Various Tandy 1000 models may use this line for the 60Hhz RAM refresh
  1309.         or as "optional bus interrupt."
  1310.      2) Used by hard disk on IBM XT and most compatibles.
  1311.      3) LPT2 on AT, XT/286, and PS/2
  1312.      4) Dummy CRT vertical retrace on PCjr
  1313.  
  1314. (internal) General Protection Violation (80286+)
  1315.            Called in real mode when an instruction attempts to access a word
  1316.            operand located at offset 0FFFFh or a PUSH MEM or POP MEM
  1317.            instruction contains an invalid bit code in the second byte, or
  1318.            when an instruction exceeds the maximum length allowed (10 bytes
  1319.            for 80286, 15 bytes for 80386)
  1320.  
  1321.  
  1322. ┌─────────────────────────────────────────────────────────────────────────────┐
  1323. │Interrupt  0Eh  Diskette Interrupt                                           │
  1324. └─────────────────────────────────────────────────────────────────────────────┘
  1325. (0:0038h)  Generated by floppy controller on completion of an operation
  1326.  (IRQ6)    (sets bit 8 of 40:3E)
  1327.  
  1328. (internal) Page Fault (80386+ native mode)
  1329.  
  1330.  
  1331. ┌─────────────────────────────────────────────────────────────────────────────┐
  1332. │Interrupt  0Fh  Reserved by IBM                                              │
  1333. └─────────────────────────────────────────────────────────────────────────────┘
  1334. (0:003Ch)  IRQ7 used by 8259 PPI interrupt (LPT1, LPT2)
  1335.  (IRQ7)
  1336. note 1) Generated by the LPT1 printer adapter when printer becomes ready. Many
  1337.         printer adapters do not reliably generate this interrupt.
  1338.      2) This interrupt is normally avoided. If a bad interrupt occurs, it will
  1339.         vector to this spot (when caused by a misprogrammed 8259 PIC)
  1340.  
  1341.